import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {SharedModule} from '../../shared/shared.module';

import {UserListComponent} from './user-list/user-list.component';
import {UserDetailComponent} from './user-detail/user-detail.component';
import {UserBankCardListComponent} from './user-bank-card-list/user-bank-card-list.component';
import {UserJlbListComponent} from './user-jlb-list/user-jlb-list.component';
import {UserMinerWorkRecordListComponent} from './user-miner-work-record-list/user-miner-work-record-list.component';
import {UserPurchaseMinerRecordListComponent} from './user-purchase-miner-record-list/user-purchase-miner-record-list.component';
import {UserDepositListComponent} from './user-deposit-list/user-deposit-list.component';
import {UserEditComponent} from './user-edit/user-edit.component';
import {UserSubAccountComponent} from './user-sub-account/user-sub-account.component';
import {UserActiveComponent} from './user-active/user-active.component';
import {UserOreComponent} from './user-ore/user-ore.component';

const routes: Routes = [
  {path: '', redirectTo: ' users'},
  {
    path: 'users', component: UserListComponent, children: [
      {path: 'add', component: UserEditComponent},
      {path: 'modify/:code', component: UserEditComponent},
      {path: 'detail/:code', component: UserDetailComponent}
    ]
  },

  {path: 'user-bank-card', component: UserBankCardListComponent},

  {path: 'user-jlb', component: UserJlbListComponent},

  {path: 'user-ore', component: UserOreComponent},

  {path: 'user-miner-work-record', component: UserMinerWorkRecordListComponent},

  {path: 'user-purchase-miner-record', component: UserPurchaseMinerRecordListComponent},

  {path: 'user-deposit', component: UserDepositListComponent},

  {path: 'user-active', component: UserActiveComponent},
];

@NgModule({
  imports: [
    SharedModule.forRoot(),
    RouterModule.forChild(routes)
  ],
  declarations: [
    UserListComponent,
    UserDetailComponent,
    UserBankCardListComponent,
    UserJlbListComponent,
    UserMinerWorkRecordListComponent,
    UserPurchaseMinerRecordListComponent,
    UserDepositListComponent,
    UserEditComponent,
    UserSubAccountComponent,
    UserActiveComponent,
    UserOreComponent
  ],
  providers: [],
  entryComponents: [UserSubAccountComponent]
})
export class UserModule {
}
